
package com.bluelinelabs.conductor.demo.controllers;


import ohos.agp.components.Image;
import ohos.agp.components.Text;

import com.bluelinelabs.conductor.demo.ResourceTable;
import com.bluelinelabs.conductor.demo.controllers.base.BaseController;

/**
 * lipeiquan
 *
 * @since 2021-05-06
 */
public class CityDetailController extends BaseController {
    int drawableRes;
    String titleText;

    public CityDetailController() {
        super(ResourceTable.Layout_controller_city_detail);
    }

    public CityDetailController(int drawableRes, String title) {
        super(ResourceTable.Layout_controller_city_detail);
        this.drawableRes = drawableRes;
        this.titleText = title;
    }


    @Override
    public void onViewCreated(ohos.agp.components.Component component) {
        title = titleText;
        ((Image) component.findComponentById(ResourceTable.Id_imageView)).setPixelMap(drawableRes);
        ((Text) component.findComponentById(ResourceTable.Id_textView)).setText(titleText);
    }
}
